import http from '@/api/axios';
import { Audit, ExportData, ResPage, ResultData } from '@/api/types';
import { BASE_SERVICE } from '@/api/axios/config/servicePort';

export const validatesCourseFee = (uuid: string) => {
	return http.get<Audit.Course[]>(BASE_SERVICE + '/audit/course/validate/' + uuid, {});
};

export const validatedExport = (uuid: string) => {
	return http.get<ExportData>(BASE_SERVICE + '/audit/course/validate/export/' + uuid, {});
};

export const uploadResources = (formData: any) => {
	return http.post<ResultData>(BASE_SERVICE + '/audit/course/resources/upload', formData);
};

export const getTeacherList = (queryParams: any, pageNum = 1, pageSize = 10) => {
	return http.post<ResPage<Audit.Teacher[]>>(BASE_SERVICE + '/audit/teacher/page?pageNum=' + pageNum + '&pageSize=' + pageSize, queryParams);
};

export const teacherClass = (id: number) => {
	return http.get<Audit.TeacherClass[]>(BASE_SERVICE + '/audit/teacher/class/' + id, {});
};

export const saveOrUpdate = (params: any) => {
	return http.post<ResultData>(BASE_SERVICE + '/audit/teacher/saveOrUpdate', params);
};
export const deleteById = (id: number) => {
	return http.delete<ResultData>(BASE_SERVICE + '/audit/teacher/delete/' + id, {});
};

export const addClass = (params: any) => {
	return http.post<ResultData>(BASE_SERVICE + '/audit/teacher/class/add', params);
};

export const deleteClass = (id: number) => {
	return http.delete<ResultData>(BASE_SERVICE + '/audit/teacher/class/' + id, {});
};
